# -*- coding: utf-8 -*-
from django import forms
from snewi.models import Url, Opinion, BlogEntry, Entity

class UrlForm(forms.ModelForm):
    class Meta:
        model = Url
        exclude = ('user', )

class BlogEntryForm(forms.ModelForm):
    class Meta:
        model = BlogEntry
        exclude = ('user', )

class OpinionForm(forms.ModelForm):
    entity = forms.ModelChoiceField(queryset=Entity.objects.all(), widget=forms.HiddenInput)
    rating = forms.IntegerField(widget=forms.RadioSelect(choices=Opinion.RATING_CHOICES))
    comment = forms.CharField(widget=forms.Textarea(), required=False)
    class Meta:
        model = Opinion
        exclude = ('user', )

class LoginForm(forms.Form):
    username = forms.CharField(max_length = 30)
    password = forms.CharField(max_length = 30)

